package com.supermap.dataservice.mysql.dao;

import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface DataMapper {

    @SelectProvider(type = SqlProvider.class, method = "selectSql")
    public List<Map> select(String sql);

    @UpdateProvider(type = SqlProvider.class, method = "updateSql")
    public int update(String sql);

    @DeleteProvider(type = SqlProvider.class, method = "deleteSql")
    public int delete(String sql);

    @InsertProvider(type = SqlProvider.class, method = "insertSql")
    public int insert(String sql);

    class SqlProvider {
        public String selectSql(String sql) {
            return sql;
        }

        public String updateSql(String sql) {
            return sql;
        }

        public String deleteSql(String sql) {
            return sql;
        }

        public String insertSql(String sql) {
            return sql;
        }
    }
}
